﻿using System;
using NiYo.ParserBuilder.Domain.Hl7.DataTypes;

namespace NiYo.ParserBuilder.Domain.Hl7.Segments
{
    /// <summary>
    /// MessageHeader
    /// </summary>
    public class MessageHeader : Hl7Segment
    {
        #region " - Properties - "

        /// <summary>
        /// Field Separator.
        /// Standard HL7 position: MSH-1
        /// </summary>
        public string FieldSeparator { get; set; }

        /// <summary>
        /// Encoding Characters.
        /// Standard HL7 position: MSH-2
        /// </summary>
        public string EncodingCharacters { get; set; }

        /// <summary>
        /// Sending Application.
        /// Standard HL7 position: MSH-3
        /// </summary>
        public string SendingApplication { get; set; }

        /// <summary>
        /// Sending Facility.
        /// Standard HL7 position: MSH-4
        /// </summary>
        public string SendingFacility { get; set; }

        /// <summary>
        /// Receiving Application.
        /// Standard HL7 position: MSH-5
        /// </summary>
        public string ReceivingApplication { get; set; }

        /// <summary>
        /// Receiving Facility.
        /// Standard HL7 position: MSH-6
        /// </summary>
        public string ReceivingFacility { get; set; }

        /// <summary>
        /// Date/Time Message.
        /// Standard HL7 position: MSH-7
        /// </summary>
        public DateTime? DateTimeMessage { get; set; }

        /// <summary>
        /// Security related information of the message
        /// Standard HL7 position: MSH-8
        /// </summary>
        public string Security { get; set; }

        /// <summary>
        /// Message Type.
        /// Standard HL7 position: MSH-9
        /// 
        /// Exemples: ADT, MFN, ORU,...
        /// </summary>
        public CompositeMessageType MessageType { get; set; }

        /// <summary>
        /// Message Control Id.
        /// Standard HL7 position: MSH-10
        /// </summary>
        public string MessageControlId { get; set; }

        /// <summary>
        /// Processing Id.
        /// Standard HL7 position: MSH-11
        /// </summary>
        public string ProcessingId { get; set; }

        /// <summary>
        /// Version Id.
        /// Standard HL7 position: MSH-12
        /// </summary>
        public string VersionId { get; set; }

        /// <summary>
        /// Accept Acknowledgement Type
        /// Standard HL7 position: MSH-15
        /// </summary>
        public string AcceptAcknowledgementType { get; set; }

        /// <summary>
        /// Contains the conditions under which Application Acknowledgements are required to be returned in response to this message 
        /// Standard HL7 position: MSH-16
        /// </summary>
        public string ApplicationAcknowledgementType { get; set; }

        /// <summary>
        /// Country code
        /// Standard HL7 position: MSH-17
        /// </summary>
        public string CountryCode { get; set; }

        /// <summary>
        /// Character set
        /// Standard HL7 position: MSH-18
        /// </summary>
        public string CharacterSet { get; set; }

        /// <summary>
        /// Principal Language of the message
        /// Standard HL7 position: MSH-19
        /// </summary>
        public CodedElement PrincipalLanguage { get; set; }

        /// <summary>
        /// Alternate Character Set Handling Scheme
        /// Standard HL7 position : MSH-20
        /// When any alternative character sets are used (as specified in the second or later iterations of MSH-18 character sets), and if any special handling scheme is needed, this component is to specify the scheme used, according to HL7 Table 0356- Alternate character set handling scheme  
        /// </summary>
        public string AlternateCharacterSet { get; set; }

        /// <summary>
        /// Message Profile Identifier 
        /// Standard HL7 position : MSH-21
        /// Sites may use this field to assert adherence to, or reference, a message profile. Message profiles contain detailed explanations of grammar, syntax, and usage for a particular message or set of messages
        /// </summary>
        public EntityIdentifier MessageProfileIdentifier { get; set; } 

        /// <summary>
        /// Sending Responsible Organization
        /// Standard HL7 position : MSH-22
        /// Business organization that originated and is accountable for the content of the message.
        /// </summary>
        public ExtendedCompositeNameAndIdNumberForOrganizations SendingResponsibleOrganization { get; set; }

        /// <summary>
        /// Receiving Responsible Organization   
        /// Standard HL7 position : MSH-23
        /// Business organization that is the intended receiver of the message and is accountable for acting on the data conveyed by the transaction
        /// </summary>
        public ExtendedCompositeNameAndIdNumberForOrganizations ReceivingResponsibleOrganization { get; set; }

        /// <summary>
        /// Sending Network Address
        /// Standard HL7 position : MSH-24
        /// Identifier of the network location the message was transmitted from.  Identified by an OID or text string (e.g. URI). 
        /// </summary>
        public string SendingNetworkAddress { get; set; }

        /// <summary>
        /// Receiving Network Address   
        /// Standard HL7 position : MSH-25
        /// Identifier of the network location the message was transmitted from.  Identified by an OID or text string (e.g. URI). 
        /// </summary>
        public string ReceivingNetworkAddress { get; set; }
        #endregion

    }
}